

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<script type="text/javascript" src="helpman_topicinit.js"></script>

<title>Interaction Operators [Enterprise Architect User Guide]</title>

<meta name="keywords" content="Enterprise Architect, Sparx Systems, UML, Combined Fragment,Combined Fragment Interaction Operator,Interaction Operator,Interaction Operator Combined Fragment">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta http-equiv="Content-Style-Type" content="text/css" />

<link type="text/css" href="default.css" rel="stylesheet" />
<style type="text/css">
  A, A:Visited
  {
    color: #00F;
  }

  A:Active, A:Hover
  {
    color: #F00;
  }

  OL
  {
    margin: 5px 0 5px 48px;
  }

  UL
  {
    margin-bottom: 3px;
    margin-top: 0;
  }

  #nsr
  {
    background-color: #D4DFFF;
  }

  #nsr A
  {
    text-decoration: none;
  }

  #mainbody
  {
    padding: 8px;
  }

  .p_BodyText
  {
    padding: 5px 0;
  }
</style>



<style type="text/css" media="screen">
  BODY
  {
    background-color: #FFFFFF;
  }

  #nsr
  {
    padding: 6px 6px 0 6px;
    border-bottom: none;
    vertical-align: top;
    z-index: 2;
    visibility: visible;
    left: 0;
    top: 0;
    position: absolute;
  }

  #mainbody
  {
    left: 0;
    top: 0;
    margin: 0;
    position: absolute;
    padding: 10px;
    overflow: auto;
    height: 100%;
    z-index: 1;
    background-repeat: no-repeat;
    background-position: bottom right;
    background-attachment: fixed;
  }
</style>

<style type="text/css" media="print">
  #nsr
  {
    visibility: none;
  }

  #mainbody
  {
    overflow: visible;
  }
</style>
<script type="text/javascript" language="JavaScript" src="nonscroll.js"></script>

</head>
<body scroll="no">

<div id="page">



        <div id="content">
          <div id="content-inner">
          



  
          <div id="nsr">
            <table border="0" cellspacing="0" cellpadding="4" width="100%">
              <tr valign="top">
                <td align="left">
  


                  <p class="p_Heading1"><span class="f_Heading1">Interaction Operators</span></p>



  
                </td>
                <td align="right">
                  <a href="introduction.htm" onmouseover="document.images.main.src='button_main_h.gif'" onmouseout="document.images.main.src='button_main.gif'">
                    <img name="main" src="button_main.gif" border=0 alt="Return to Introduction">
                  </a>&nbsp;
    
                  <a href="createacombinedfragment.htm" onmouseover="document.images.prev.src='button_prev_h.gif'" onmouseout="document.images.prev.src='button_prev.gif'">
                    <img name=prev src="button_prev.gif" border=0 alt="Previous page" />
                  </a>&nbsp;
    
    
    
                  <a href="datastore.htm" onmouseover="document.images.next.src='button_next_h.gif'" onmouseout="document.images.next.src='button_next.gif'">
                    <img name=next src="button_next.gif" border=0 alt="Next page" />
                  </a>
    
    
                </td>
              </tr>
            </table>
          </div>
          <div id="mainbody">
  


                <p class="p_BodyText"><span class="f_BodyText">When creating <a href="fragment.htm">Combined Fragments</a>, you must apply an appropriate interaction operator to characterize the fragment. The following table provides guidance on the various operators, and their corresponding descriptions.</span></p>
<div style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 0px; margin: 5px 0px 5px 13px;"><table cellspacing="0" cellpadding="0" border="0" style="border: none; border-spacing:0px; border-collapse: collapse;">
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="138" bgcolor="#e3e6ed" style="width:138px; background-color:#e3e6ed; border: solid 1px #000000;"><p class="p_Tableheader"><span class="f_Tableheader">Interaction Operator</span></p>
</td>
<td valign="top" width="545" bgcolor="#e3e6ed" style="width:545px; background-color:#e3e6ed; border: solid 1px #000000;"><p class="p_Tableheader"><span class="f_Tableheader">Use to</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="138" style="width:138px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">alt</span></p>
</td>
<td valign="top" width="545" style="width:545px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Divide up interaction fragments based on Boolean conditions.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="138" style="width:138px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">opt</span></p>
</td>
<td valign="top" width="545" style="width:545px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Enclose an optional fragment of interaction.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="138" style="width:138px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">par</span></p>
</td>
<td valign="top" width="545" style="width:545px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Indicate that operands operate in parallel.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="138" style="width:138px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">loop</span></p>
</td>
<td valign="top" width="545" style="width:545px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Indicate that the operand repeats a number of times, as specified by interaction constraints.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="138" style="width:138px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">critical</span></p>
</td>
<td valign="top" width="545" style="width:545px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Indicate a sequence that cannot be interrupted by other processing.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="138" style="width:138px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">neg</span></p>
</td>
<td valign="top" width="545" style="width:545px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Assert that a fragment is invalid, and implies that all other interaction is valid.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="138" style="width:138px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">assert</span></p>
</td>
<td valign="top" width="545" style="width:545px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Specify the only valid fragment to occur. Often enclosed within a </span><span class="f_Tabletext" style="font-style: italic;">consider</span><span class="f_Tabletext"> or </span><span class="f_Tabletext" style="font-style: italic;">ignore</span><span class="f_Tabletext"> operand.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="138" style="width:138px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">strict</span></p>
</td>
<td valign="top" width="545" style="width:545px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Indicate that the behaviors of the operands must be processed in strict sequence.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="138" style="width:138px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">seq</span></p>
</td>
<td valign="top" width="545" style="width:545px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Indicate that the Combined Fragment is weakly sequenced. This means that the ordering within operands is maintained, but the ordering between operands is undefined, so long as an event occurrence of the first operand precedes that of the second operand, if the event occurrences are on the same lifeline.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="138" style="width:138px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">ignore</span></p>
</td>
<td valign="top" width="545" style="width:545px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Indicate which messages should be ignored during execution, or can appear anywhere in the execution trace.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="138" style="width:138px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">consider</span></p>
</td>
<td valign="top" width="545" style="width:545px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Specify which messages should be considered in the trace. This is often used to specify the resulting event occurrences with the use of an </span><span class="f_Tabletext" style="font-weight: bold;">assert</span><span class="f_Tabletext"> operator.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="138" style="width:138px; border: solid 1px #000000;"><p class="p_Tabletext"><a name="ref"></a><span class="f_Tabletext" style="font-weight: bold;">ref</span></p>
</td>
<td valign="top" width="545" style="width:545px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Provide a reference to another diagram.</span></p>
<div style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 0px; margin: 4px 2px 4px 2px;"><table cellspacing="0" cellpadding="2" border="0" style="border: none; border-spacing:0px;">
<tr style="text-align:left;vertical-align:bottom;">
<td valign="bottom" bgcolor="#efeff7" style="background-color:#efeff7;"><p class="p_TiporNote" style="border-top: none; border-right: none; border-left: none;"><span class="f_TiporNote">Note:</span></p>
</td>
</tr>
<tr style="text-align:left;">
<td bgcolor="#f7f7ff" style="background-color:#f7f7ff;"><p class="p_TiporNoteText"><span class="f_TiporNoteText">The </span><span class="f_TiporNoteText">ref</span><span class="f_TiporNoteText"> fragment is not created using the method described in the </span><span class="f_TiporNoteText" style="font-style: italic;"><a href="createacombinedfragment.htm">Create a Combined Fragment</a></span><span class="f_TiporNoteText"> topic. To create a </span><span class="f_TiporNoteText">ref</span><span class="f_TiporNoteText"> fragment, simply drag an existing diagram from the </span><span class="f_UIControl">Project Browser</span><span class="f_TiporNoteText"> onto the current diagram.</span></p>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
<p class="p_SubHeadingL1"><span class="f_SubHeadingL1">OMG UML Specification</span></p>
<p class="p_BodyText"><span class="f_BodyText">The OMG UML specification (</span><span class="f_BodyText" style="font-style: italic;">UML Superstructure Specification, v2.1.1, p. 468-471</span><span class="f_BodyText">) states:</span></p>
<p class="p_OMGText"><span class="f_OMGText">The semantics of a CombinedFragment is dependent upon the interactionOperator as explained below.</span></p>
<p class="p_OMGText"><span class="f_OMGText" style="font-size: 11pt;">Alternatives</span></p>
<p class="p_OMGText"><span class="f_OMGText">The interactionOperator </span><span class="f_OMGText" style="font-weight: bold;">alt</span><span class="f_OMGText"> designates that the CombinedFragment represents a choice of behavior. At most one of the operands will be chosen. The chosen operand must have an explicit or implicit guard expression that evaluates to true at this point in the interaction. An implicit true guard is implied if the operand has no guard.</span></p>
<p class="p_OMGText"><span class="f_OMGText">The set of traces that defines a choice is the union of the (guarded) traces of the operands.</span></p>
<p class="p_OMGText"><span class="f_OMGText">An operand guarded by</span><span class="f_OMGText" style="font-weight: bold;"> else</span><span class="f_OMGText"> designates a guard that is the negation of the disjunction of all other guards in the enclosing CombinedFragment.</span></p>
<p class="p_OMGText"><span class="f_OMGText">If none of the operands has a guard that evaluates to true, none of the operands are executed and the remainder of the enclosing InteractionFragment is executed.</span></p>
<p class="p_OMGText"><span class="f_OMGText" style="font-size: 11pt;">Option</span></p>
<p class="p_OMGText"><span class="f_OMGText">The interactionOperator </span><span class="f_OMGText" style="font-weight: bold;">opt</span><span class="f_OMGText"> designates that the CombinedFragment represents a choice of behavior where either the (sole) operand happens or nothing happens. An option is semantically equivalent to an alternative CombinedFragment where there is one operand with non-empty content and the second operand is empty.</span></p>
<p class="p_OMGText"><span class="f_OMGText" style="font-size: 11pt;">Break</span></p>
<p class="p_OMGText"><span class="f_OMGText">The interactionOperator </span><span class="f_OMGText" style="font-weight: bold;">break</span><span class="f_OMGText"> </span><span class="f_OMGText">designates that the CombinedFragment represents a breaking scenario in the sense that the operand is a scenario that is performed instead of the remainder of the enclosing InteractionFragment. A </span><span class="f_OMGText" style="font-weight: bold;">break</span><span class="f_OMGText"> operator with a guard is chosen when the guard is true and the rest of the enclosing Interaction Fragment is ignored. When the guard of the </span><span class="f_OMGText" style="font-weight: bold;">break</span><span class="f_OMGText"> operand is false, the </span><span class="f_OMGText" style="font-weight: bold;">break</span><span class="f_OMGText"> operand is ignored and the rest of the enclosing InteractionFragment is chosen. The choice between a </span><span class="f_OMGText" style="font-weight: bold;">break</span><span class="f_OMGText"> operand without a guard and the rest of the enclosing InteractionFragment is done non-deterministically.</span></p>
<p class="p_OMGText"><span class="f_OMGText">A CombinedFragment with interactionOperator </span><span class="f_OMGText" style="font-weight: bold;">break</span><span class="f_OMGText"> should cover all Lifelines of the enclosing InteractionFragment.</span></p>
<p class="p_OMGText"><span class="f_OMGText" style="font-size: 11pt;">Parallel</span></p>
<p class="p_OMGText"><span class="f_OMGText">The interactionOperator</span><span class="f_OMGText" style="font-weight: bold;"> par</span><span class="f_OMGText"> designates that the CombinedFragment represents a parallel merge between the behaviors of the operands. </span><span class="f_OMGText">The OccurrenceSpecifications of the different operands can be interleaved in any way as long as the ordering imposed by each operand as such is preserved.</span></p>
<p class="p_OMGText"><span class="f_OMGText">A parallel merge defines a set of traces that describes all the ways that OccurrenceSpecifications of the operands may be interleaved without obstructing the order of the OccurrenceSpecifications within the operand.</span></p>
<p class="p_OMGText"><span class="f_OMGText" style="font-size: 11pt;">Weak Sequencing</span></p>
<p class="p_OMGText"><span class="f_OMGText">The interactionOperator </span><span class="f_OMGText" style="font-weight: bold;">seq</span><span class="f_OMGText"> designates that the CombinedFragment represents a weak sequencing between the behaviors of the operands.</span></p>
<p class="p_OMGText"><span class="f_OMGText">Weak sequencing is defined by the set of traces with these properties:</span></p>
<ol style="text-indent: 0px; margin-left: 26px; list-style-position: outside;">
<li value=1><span class="f_OMGText">The ordering of OccurrenceSpecifications within each of the operands is maintained in the result.</span></li>
<li value=2><span class="f_OMGText">OccurrenceSpecifications on different lifelines from different operands may come in any order.</span></li>
<li value=3><span class="f_OMGText">OccurrenceSpecifications on the same lifeline from different operands are ordered such that an OccurrenceSpecification of the first operand comes before that of the second operand.</span></li>
</ol>
<p class="p_OMGText"><span class="f_OMGText">Thus weak sequencing reduces to a parallel merge when the operands are on disjunct sets of participants. Weak sequencing reduces to strict sequencing when the operands work on only one participant.</span></p>
<p class="p_OMGText"><span class="f_OMGText" style="font-size: 11pt;">Strict Sequencing</span></p>
<p class="p_OMGText"><span class="f_OMGText">The interactionOperator </span><span class="f_OMGText" style="font-weight: bold;">strict</span><span class="f_OMGText"> designates that the CombinedFragment represents a strict sequencing between the behaviors of the operands. The semantics of strict sequencing defines a strict ordering of the operands on the first level within the CombinedIFragment with interactionOperator </span><span class="f_OMGText" style="font-weight: bold;">strict</span><span class="f_OMGText">. Therefore OccurrenceSpecifications within contained CombinedFragment will not directly be compared with other OccurrenceSpecifications of the enclosing CombinedFragment.</span></p>
<p class="p_OMGText"><span class="f_OMGText" style="font-size: 11pt;">Negative</span></p>
<p class="p_OMGText"><span class="f_OMGText">The interactionOperator </span><span class="f_OMGText" style="font-weight: bold;">neg</span><span class="f_OMGText"> designates that the CombinedFragment represents traces that are defined to be invalid.</span></p>
<p class="p_OMGText"><span class="f_OMGText">The set of traces that defined a CombinedFragment with interactionOperator negative is equal to the set of traces given by its (sole) operand, only that this set is a set of invalid rather than valid traces. All InteractionFragments that are different from Negative are considered positive meaning that they describe traces that are valid and should be possible.</span></p>
<p class="p_OMGText"><span class="f_OMGText" style="font-size: 11pt;">Critical Region</span></p>
<p class="p_OMGText"><span class="f_OMGText">The interactionOperator </span><span class="f_OMGText" style="font-weight: bold;">critical</span><span class="f_OMGText"> designates that the CombinedFragment represents a critical region. A critical region means that the traces of the region cannot be interleaved by other OccurrenceSpecifications (on those Lifelines covered by the region). This means that the region is treated atomically by the enclosing fragment when determining the set of valid traces. Even though enclosing CombinedFragments may imply that some OccurrenceSpecifications may interleave into the region, such as with </span><span class="f_OMGText" style="font-weight: bold;">par</span><span class="f_OMGText">-operator, this is prevented by defining a region.</span></p>
<p class="p_OMGText"><span class="f_OMGText">Thus the set of traces of enclosing constructs are restricted by critical regions.</span></p>
<p class="p_OMGText"><span class="f_OMGText" style="font-size: 11pt;">Ignore / Consider</span></p>
<p class="p_OMGText"><span class="f_OMGText">(p. 473) The interactionOperator </span><span class="f_OMGText" style="font-weight: bold;">ignore</span><span class="f_OMGText"> designates that there are some message types that are not shown within this combined fragment. These message types can be considered insignificant and are implicitly ignored if they appear in a corresponding execution. Alternatively one can understand </span><span class="f_OMGText" style="font-weight: bold;">ignore</span><span class="f_OMGText"> to mean that the messages that are ignored can appear anywhere in the traces.</span></p>
<p class="p_OMGText"><span class="f_OMGText">Conversely the interactionOperator </span><span class="f_OMGText" style="font-weight: bold;">consider</span><span class="f_OMGText"> designates which messages should be considered within this CombinedFragment. This is equivalent to defining every other message to be ignored.</span></p>
<p class="p_OMGText"><span class="f_OMGText" style="font-size: 11pt;">Assertion</span></p>
<p class="p_OMGText"><span class="f_OMGText">The interactionOperator </span><span class="f_OMGText" style="font-weight: bold;">assert</span><span class="f_OMGText"> designates that the CombinedFragment represents an assertion. The sequences of the operand of the assertion are the only valid continuations. All other continuations result in an invalid trace. Assertions are often combined with Ignore or Consider.</span></p>
<p class="p_OMGText"><span class="f_OMGText" style="font-size: 11pt;">Loop</span></p>
<p class="p_OMGText"><span class="f_OMGText">The interactionOperator </span><span class="f_OMGText" style="font-weight: bold;">loop</span><span class="f_OMGText"> designates that the CombinedFragment represents a loop. The </span><span class="f_OMGText" style="font-weight: bold;">loop</span><span class="f_OMGText"> operand will be repeated a number of times.</span></p>
<p class="p_OMGText"><span class="f_OMGText">The Guard may include a lower and an upper number of iterations of the loop as well as a Boolean expression. The semantics is such that a loop will iterate minimum the 'minint' number of times (given by the iteration expression in the guard) and at most the 'maxint' number of times. After the minimum number of iterations have executed, and the boolean expression is false the loop will terminate. The loop construct represent a recursive application of the </span><span class="f_OMGText" style="font-weight: bold;">seq</span><span class="f_OMGText"> operator where the </span><span class="f_OMGText" style="font-weight: bold;">loop</span><span class="f_OMGText"> operand is sequenced after the result of earlier iterations.</span></p>
<p class="p_OMGText"><span class="f_OMGText" style="font-size: 11pt;">The Semantics of Gates</span></p>
<p class="p_OMGText"><span class="f_OMGText">The gates of a CombinedFragment represent the syntactic interface between the CombinedFragment and its surroundings, which means the interface towards other InteractionFragments.</span></p>
<p class="p_OMGText"><span class="f_OMGText">The only purpose of gates is to define the source and the target of messages.</span></p>




            </div>
          </div>
        </div>



</div>


</body>
</html>
